<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
<!--v-if根据表达式真假切换元素的显示和隐藏操作dom元素
    -->
<div id="app">
<input type="button" value="切换显示" @click="change">
<span v-if="age>18&&show">123456</span>
</div>
<script>
    var  app=new Vue({
        el:"#app",
        data:{
            show:true,
            age:19
        },
        methods:{
            change:function () {
                this.show=!this.show;
            }
        }
    })
</script>
</body>
</html>